﻿using MagicSoundPro;

namespace SiMay.RemoteMonitor.Application
{
    public partial class AudioConfigurationForm : Form
    {
        public AudioConfigurationForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            SystemAppConfig.AudioSamplesPerSecond = short.Parse(nSamplesPerSec.Text);
            SystemAppConfig.AudioBitsPerSample = short.Parse(wBitsPerSample.Text);
            SystemAppConfig.AudioChannels = short.Parse(nChannels.Text);
            MessageBox.Show("设置保存成功,但设置需重新打开语音功能模块后才能生效。", "提示", 0, MessageBoxIcon.Exclamation);
            this.Close();
        }

        private void AudioConfigurationManager_Load(object sender, EventArgs e)
        {
            nSamplesPerSec.Text = SystemAppConfig.AudioSamplesPerSecond.ToString();
            wBitsPerSample.Text = SystemAppConfig.AudioBitsPerSample.ToString();
            nChannels.Text = SystemAppConfig.AudioChannels.ToString();
        }
    }
}
